﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/21/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_service_dml_upd]
	@SERVICE_ID INT
	,@AUDIT_MOD_USER VARCHAR(100)
	,@AUDIT_MOD_DTTM DATETIME
	,@AUDIT_MOD_DTTM_TZ INT
	,@RLS_MASK VARBINARY(256)
	,@RLS_OWNER UNIQUEIDENTIFIER
	,@BUILTIN BIT
	,@WRKFL_ITEM_ID INT
	,@WRKFL_STATUS_ID INT
	,@ACTIVE_FLG BIT
	,@SORT_ORDER INT
	,@SERVICE_NAME VARCHAR(100)
	,@SERVICE_SNAME VARCHAR(50)
	,@SERVICE_DESC VARCHAR(MAX)
	,@SERVICE_TYPE INT
	,@PARENT_ID INT
	,@DOMAIN_ID INT
	,@ORG_ID INT
	,@RESOURCE_ID INT
	,@SUPPLIER_ID INT
	,@SLA_ID INT
	
AS
BEGIN TRY
	UPDATE [flcr].[SERVICE]
	   SET [AUDIT_MOD_USER] = @AUDIT_MOD_USER
		  ,[AUDIT_MOD_DTTM] = @AUDIT_MOD_DTTM
		  ,AUDIT_MOD_DTTM_TZ = @AUDIT_MOD_DTTM_TZ
		  ,[RLS_MASK] = @RLS_MASK
		  ,[RLS_OWNER] = @RLS_OWNER
		  ,[BUILTIN] = @BUILTIN
		  ,[WRKFL_ITEM_ID] = @WRKFL_ITEM_ID
		  ,[WRKFL_STATUS_ID] = @WRKFL_STATUS_ID
		  ,[ACTIVE_FLG] = @ACTIVE_FLG
		  ,[SORT_ORDER] = @SORT_ORDER
		  ,[SERVICE_NAME] = @SERVICE_NAME
		  ,[SERVICE_SNAME] = @SERVICE_SNAME
		  ,[SERVICE_DESC] = @SERVICE_DESC
		  ,[SERVICE_TYPE] = @SERVICE_TYPE
		  ,[PARENT_ID] = @PARENT_ID
		  ,[DOMAIN_ID] = @DOMAIN_ID
		  ,[ORG_ID] = @ORG_ID
		  ,[RESOURCE_ID] = @RESOURCE_ID
		  ,[SUPPLIER_ID] = @SUPPLIER_ID
		  ,[SLA_ID] = @SLA_ID
	 WHERE [SERVICE_ID] = @SERVICE_ID

END TRY
BEGIN CATCH
	EXEC flcr.[utl_getDBError];
END CATCH